import { RouteRecordRaw } from "vue-router"
import AppLayout from '@/myProject/src/views/AppView.vue'
/**
 * @param hidden true是 false否 隐藏路由,
 * @param name 不写那么在面包屑中将不会展示
 * @param noBreadcrumb  true是 false否 是否需要面包屑
 * @param requireAuth true是 false否 是否需要登录才能看到
 */
const routers: Array<RouteRecordRaw> = [
  {
    path: '/login',
    component: () => import('@/myProject/src/views/login/login.vue'),
    meta: {
      title: '登录',
      hidden: true
    },
  },
  {
    path: '/',
    redirect: '/home',
    component: AppLayout,
    meta: {
      title: '首页',
    },
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/myProject/src/views/home/home.vue'),
        meta: {
          title: '首页',
          noBreadcrumb: true,
          requireAuth: true
        },
      },
    ]
  },
  {
    path: '/first1',
    name: 'first1',
    redirect: '/first1/first1-1',
    component: AppLayout,
    meta: {
      title: '第一级1',
      requireAuth: true
    },
    children: [
      {
        path: 'first1-1',
        name: 'first1-1',
        component: () => import('@/myProject/src/views/first/first1.vue'),
        children: [
          {
            path: 'first3-1',
            name: 'first3-1',
            component: () => import('@/myProject/src/views/first/first3.vue'),
            meta: {
              title: '第三级-1',
              requireAuth: true,
              hidden: true,
            }
          },
          {
            path: 'first3-2',
            name: 'first3-2',
            component: () => import('@/myProject/src/views/first/first3.vue'),
            meta: {
              title: '第三级-2',
              requireAuth: true
            },
          }
        ],
        meta: {
          title: '第二级1-1',
          requireAuth: true
        },
      },
      {
        path: 'first1-2',
        name: 'first1-2',
        component: () => import('@/myProject/src/views/first/first2.vue'),
        meta: {
          title: '第二级1-2',
          requireAuth: true
        },
      },
      {
        path: 'homeDetail',
        name: 'homeDetail',
        component: () => import('@/myProject/src/views/home/homeDetail.vue'),
        meta: {
          title: '详情',
          hidden: true,
          requireAuth: true
        },
      },
    ]
  },

]

export default routers